'''
嵌套循环输出2~100之间的素数
'''
i = 2
while i < 100:
    j = 2
    while j <= (i / j):
        if not (i % j): break
        j = j + 1
    if j > i / j: print(i, " 是素数")
    i = i + 1

print("Good bye!")

'''获取5以内的质数'''

num = []
for a in range(2, 5):
    for b in range(2, a):  # range(2,2)是空列表不会进入for循环
        if a % b == 0:
            break
    else:
        num.append(a)
print(num)

'''嵌套循环实现×字塔的实现'''
i = 1
# j=1
while i <= 9:
    if i <= 5:
        print("*" * i)

    elif i <= 9:
        j = i - 2 * (i - 5)
        print("*" * j)
    i += 1
else:
    print("")

for letter in 'Python':  # 第一个实例
    if letter == 'h':
        continue
    print('当前字母 :', letter)

var = 10  # 第二个实例
while var > 0:
    var = var - 1
    if var == 5:
        continue
    print('当前变量值 :', var)
